<!DOCTYPE html>
<html lang="en">

	<head>
		<meta charset="UTF-8">
		<title>账户设置--修改密码</title>
		<link href="css/style.css" rel="stylesheet" type="text/css" />
		<link href="css/common.css" rel="stylesheet" type="text/css" />
		<link href="css/normolize.css" rel="stylesheet" type="text/css" />
		<!--[if IE 9]> <link href="css/ieHack9.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<!--[if IE 8]> <link href="css/ieHack.css" rel="stylesheet" type="text/css" /><link href="css/ieHack8.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<!--[if lte IE 7]> <link href="css/ieHack.css" rel="stylesheet" type="text/css" /> <![endif]-->
		<style>
			.form>form>div label.name{width:78px;text-align: right;display: inline-block;}
		</style>
	</head>

	<body>
		<script src="js/tpl/header.js" type="text/javascript" charset="utf-8"></script>
		<div class="page-wrapper productlist minwidth border" id="page-wrapper">
			<div class="line"></div>
			<script src="js/tpl/menu.js" type="text/javascript" charset="utf-8"></script><div class="vertival-line"></div>
			<div class="page-content">
				<div class="tablist">
					<ul>
						<li class="tabItem ">
							<a href="accountSetting.html#account">基本信息</a>
						</li>
						<li class="tabItem active">
							<a href="editPass.html#account">修改密码</a>
						</li>
					</ul>
				</div>

				<div class="clearfix">
					<div class=" over-hidden" style="padding:40px;">
						<div class="form">
							<form class="block-form" id="passForm">
							
								<div style="margin-top:0px;">
									<label class="name"><span class="red">*</span>旧密码：</label>
									<input id="old_password" name="old_password" type="text" required />
								</div>
								<div>
									<label class="name"><span class="red">*</span>新密码：</label>
									<input id="new_password" name="new_password" type="text"  required/>
								</div>
								<div>
									<label class="name"><span class="red">*</span>确认密码：</label>
									<input  id="confirm_password"  name="confirm_password" type="text" required/>
								</div>
							 
								<div style="margin-top:34px;margin-left:10px;">
									<input type="submit" value="保存" class="search-input-button bgblue border-radius" id="subButton" />
									<input type="button" value="返回" class="search-input-button border-radius" id="backButton" />
								</div>
							</form>
						</div>
					</div>

				</div>

			</div>

		</div>
		<div class="footer">
			<div class="footercontainer">
				<ul>
					<li>
						<a href="#">关于我们</a>
					</li>
					<li>
						<a href="#">服务与支持</a>
					</li>
					<li>
						<a href="#">常见问题</a>
					</li>
					<li>
						<a href="#">人才招聘</a>
					</li>
					<li>
						<a href="#">加盟合作</a>
					</li>
				</ul>

				<div style="margin-top:13px;">版权所有@ 2015 - 2016 深圳在乎传媒科技有限公司 粤ICP备15107022-1号</div>
			</div>

		</div>

	</body>

	<script src="js/jquery-1.8.2.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/layer/layer.js" type="text/javascript" charset="utf-8"></script>
	<script src="js/jquery.validate.min.js" type="text/javascript" charset="utf-8"></script>
	<!--<script src="js/messages_zh.min.js" type="text/javascript" charset="utf-8"></script>-->

	<script>
	//验证成功提交表单弹框
		$.validator.setDefaults({
			submitHandler: function() {
				layer.open({
					type: 2,
					title: false,
					shadeClose: true,
					shade: 0.8,
					area: ['380px', '244px'],
					content: 'editPassDirect.html',
					skin: 'notitleClass',
					success: function(layero, index) {
						var body = layer.getChildFrame('body', index);
						var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象，执行iframe页的方法：iframeWin.method();
					}
				});
			}
		});
		
		//这里是验证初始密码是否正确
		$.validator.addMethod("matchPassword", function(value, element) {
			var result=true;
			 return result;
		}, "<i class=\" icon icon_error_red \"></i>您输入的旧密码不正确！");
		
		$(document).ready(function() {
			$("#passForm").validate({
				rules: {
					old_password: {
						required: true,
						'matchPassword':true,
					},
					new_password: {
						required: true,
					},
					confirm_password:{
						required: true,
						equalTo: "#new_password",
					}
				},
				messages: {
					old_password: {
						required: "<i class=\" icon icon_error_red \"></i>请输入旧密码",
					},
					new_password: {
						required: "<i class=\" icon icon_error_red \"></i>请输入新密码",
					},
					confirm_password: {
						required: "<i class=\" icon icon_error_red \"></i>请输入确认密码",
						equalTo: "<i class=\" icon icon_error_red \"></i>两次输入密码不一致"
					},
				},
				errorPlacement: function(error, element) {
					console.log(error);
					error.appendTo('<i class=\" icon icon_error_red \"></i>').appendTo(element.parent());
				},
				success: function(element) {

				}
			});
		});
		
		
	</script>

</html>